package com.wondertek.poms.dao.repo;

import com.wondertek.poms.dao.po.ProductProp;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author chenjijiang
 * @description
 */
@Repository
public interface IProductPropDao extends JpaRepository<ProductProp, Long> {


    /** TODO
     *@author gaozhengxing gaozhenghang@wondertek.com.cn
     *@date 2020/12/22 19:02
     *@param productPropName 名称
     *@return  列表*/
    List<ProductProp> findByProductPropNameLike(String productPropName);

    /** 查询产品属性管理
     *@author gaozhengxing gaozhenghang@wondertek.com.cn
     *@date 2020/12/24 17:32
     *@param
     *@return  */
    @Query(value = "select * from PRODUCT_PROP pp  where pi.ID=?1 and pp.PRODUCT_PROP_NAME like %?2%  ", nativeQuery = true)
    List<ProductProp> findByIdOrName(Long id,String productPropName) ;

}
